var async = require('async');

var networkdata = function(auth) {
	async.auto({
	  fb: function(callback) {
	  	setTimeout(function() {
	  	  console.log("pulling facebook data.");
	  	  callback(null, {data: 'facebook data'});
	  	}, 5000);
	  },
	  t: function(callback) {
	  	setTimeout(function() {
	  	  console.log("pulling twitter data.");
	  	  callback(null, {data: 'twitter data'});
	  	}, 3000);
	  },
	  li: function(callback) {
	  	setTimeout(function() {
	  	  console.log("pulling linked in data.");
	  	  callback(null, {data: 'linkedin data'});
	  	}, 2000);
	  },
	  combine_results: ['fb', 't', 'li', function(callback, results) {
	  	callback(null, null);
	  }],
	  save_results: ['combine_results', function(callback, results) {
	  	console.log("riak.save()");
	  }],
	  cache_results: ['combine_results', function(callback, results) {
	  	console.log("cache.save()");
	  }],
	  render_results: ['combine_results', function(callback, results) {
	  	console.log(results);
	  }]
	});
}

// get networkdata
networkdata();